package pa14.proj.boundschecker.main;

import java.util.Map;

import soot.Body;
import soot.BodyTransformer;
import soot.G;
import soot.toolkits.graph.ExceptionalUnitGraph;

public class BoundsCheckTransformer extends BodyTransformer {
	
	public BoundsCheckTransformer() {
		super();
	}

	@SuppressWarnings("rawtypes")
	@Override
	protected void internalTransform(Body body, String arg1, Map arg2) {
		boolean verbose = true;
		
		if(verbose){ G.v().out.println("\nMethod: " + body.getMethod().getName());}
			
		BoundsCheckerAnalysis bca2 = new BoundsCheckerAnalysis(new ExceptionalUnitGraph(body));
		
		bca2.printResults();	
	}
	
	protected void print(Object str, int n){
		while(n-- != 0){
			G.v().out.print("\t");
		}
		G.v().out.println(str);
	}
		

}
